#coding:utf-8
#python:3
import sys
import time
import os
from time import sleep

BASE_PATH = os.path.dirname(os.path.realpath(__file__))
#是否输出打印信息
print_SIGN = True


def printt(everything, SIGN=True):
    def GetTime():
        return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())

    if print_SIGN and SIGN:
        py_file = sys._getframe(0).f_back.f_code.co_filename.split("\\")[-1]
        py_file = py_file.ljust(15, " ")
        func_name = sys._getframe(0).f_back.f_code.co_name
        if func_name != "<module>":
            func_name = func_name + "()"
        else:
            func_name = "--------"
        func_name = func_name.ljust(10, " ")
        lines = str(sys._getframe(0).f_back.f_lineno).ljust(5, " ")
        print("{}{} {} {} {}".format(py_file, GetTime(), func_name, lines, everything))


def Main():
    printt("Main")


if __name__ == "__main__":
    printt("test new program {}".format("base_py_3"))
    Main()